<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      /* 
      x=0;
      i=1;i<=3;x = 1;i=2;
      i=2;i<=3;x = 3;i=3;
      i=3;i<=3;x = 6;i=4;
      i=4;i<=3;
      */
      let x = 0;
      let y = 0;
      let z = 0;
      for (let i = 1; i <= 100; i++) {
        // x原地修改
        x = x + i;
        if (i % 2 === 0) {
          y = y + i;
        } else {
          x = x + i;
        }
      }

      console.log(x);
    </script>
  </body>
</html>
